home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / gs24src.zip / GSUTIL.H < prev    next >
C/C++ Source or Header  |  1992-03-21  |  2KB  |  60 lines

  1. /* Copyright (C) 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gsutil.h */
  21. /* Prototypes for procedures in gsutil.c */
  22.  
  23. /* ------ String utilities ------ */
  24.  
  25. /* Compare two strings, returning -1 if the first is less, */
  26. /* 0 if they are equal, and 1 if first is greater. */
  27. /* We can't use memcmp, because we always use unsigned characters. */
  28. extern int bytes_compare(P4(const byte *, uint, const byte *, uint));
  29.  
  30. /* Test whether a string matches a pattern with wildcards. */
  31. /* '*' = any substring, '?' = any character, '\' quotes next character. */
  32. extern int string_match(P5(const byte *str, uint len, const byte *pstr, uint plen, int ignore_case));
  33.  
  34. /* Compute a hash for a string */
  35. extern uint string_hash(P2(const byte *, uint));
  36.  
  37. /* ------ Property list utilities ------ */
  38.  
  39. /*
  40.  * The recipient of a property list typically wants to extract a set of
  41.  * known properties and disregard the rest.  The following procedure
  42.  * accomplishes this.
  43.  */
  44. #ifndef gs_prop_item_s_DEFINED
  45. struct gs_prop_item_s;
  46. #endif
  47. extern int props_extract(P6(
  48.     struct gs_prop_item_s *plist,    /* plist[count] */
  49.     int count,
  50.     const struct gs_prop_item_s *template, /* template[tcount] */
  51.                     /* (the known properties) */
  52.     int tcount,
  53.     struct gs_prop_item_s **pknown,    /* *pknown[tcount] */
  54.                     /* (these are set to point to the */
  55.                     /* corresponding items in plist, */
  56.                     /* or NULL if the item is absent) */
  57.     int finished            /* if true, mark remaining items */
  58.                     /* in plist as pv_unknown */
  59. ));
  60.